<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="utf-8" />
	<link rel="stylesheet" href="__ADMIN_STATICS__/bootstrap/dist/css/bootstrap.css" type="text/css" />
	<link rel="stylesheet" href="__ADMIN_STATICS__/animate.css/animate.css" type="text/css" />
	<link rel="stylesheet" href="__ADMIN_STATICS__/font-awesome/css/font-awesome.min.css" type="text/css" />
	<link rel="stylesheet" href="__ADMIN_STATICS__/simple-line-icons/css/simple-line-icons.css" type="text/css" />
	<link rel="stylesheet" href="__ADMIN_STATICS__/bootstrap-editable/css/bootstrap-editable.min.css" type="text/css" />
	<link rel="stylesheet" href="__ADMIN_STATICS__/app/css/font.css" type="text/css" />
	<link rel="stylesheet" href="__ADMIN_STATICS__/app/css/app.css" type="text/css" />
</head>
<body>
<div class="wrapper-md">
   	<div class="panel panel-default">
	    <div class="panel-heading">
	    	<a href="{:U('Admin/Index/welcome')}"><i class="fa fa-home"></i>&nbsp;首页</a>&nbsp;&gt;&nbsp;&nbsp;管理员列表
	    	<a href="{:U('Admin/Rule/add_admin')}" class="btn btn-primary btn-xs menu-add pull-right">添加管理员</a>
	    </div>
	    <div class="table-responsive">
			<table class="table table-bordered table-hover table-condensed b-t b-light">
				<thead>
				 	<tr>
				        <th width="10%">用户名</th>
				        <th>用户组</th>
				        <th>操作</th>
				    </tr>
				</thead>
				<tbody>
					<foreach name="data" item="v">
						 <tr>
				            <td>{$v['username']}</td>
				            <td>{$v['title']}</td>
				            <td>
				                <a href="{:U('Admin/Rule/edit_admin',array('id'=>$v['id']))}" class="btn btn-default btn-xs menu-edit">修改权限或密码</a>
				            </td>
				        </tr>	
					</foreach>
				</tbody>
			</table>
	    </div>
  	</div>
</div>
<script src="__ADMIN_STATICS__/jquery/jquery.min.js"></script>
<script src="__ADMIN_STATICS__/bootstrap/dist/js/bootstrap.js"></script>
<script src="__ADMIN_STATICS__/bootstrap-editable/js/bootstrap-editable.min.js"></script>
<script type="text/javascript">
$(function(){
	$.fn.editable.defaults.emptytext = '----';
	$('.menu-name').editable({

	});
	$('.menu-url').editable({
		
	});
	$('.menu-sort').editable({
		
	});
	$('.menu-show').editable({
		
	});
	$('.sort').click(function(){
		var id = $(this).parents('tr').attr('menuId');
		var a = $(this).find('a');
		var isShow = 0;
		if(a.hasClass('active')){
			isShow = 0;
			a.removeClass('active')
		}else{
			isShow = 1;
			a.addClass('active')
		}
		var para = {
				'menu.id':id,
				'menu.isShow':isShow
		}
		$ajax(para);
	});
	
	$ajax = function(para){
		$.post(updateUrl, para, function (data) {
			console.log(data);			
		});
	}
	
});
</script>
</body>
</html>
